package net.trombonium.steroid;

import android.content.Context;
import android.location.Location;
import android.location.LocationManager;

public class GPS{


	public static String location(Context context){
		LocationManager locationManager;
		locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
		Location location;
		if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))
			location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
		else
			location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

		if (location != null)
			return String.valueOf(location.getLatitude())+","+String.valueOf(location.getLongitude());
		else
			return "Location Unavailable"; 
	}
}
